<template>
  <div class="doctoryishengshengtop">
    <div class="doctorytitle">
      <div class="diyidoctory"></div>
      <font>医生详情</font>
    </div>
    <div class="dierdoctory">
      <hr color="#F7FAFD" />
    </div>
    <div class="disandoctory">
      <font>医生信息</font>
    </div>
    <div class="disidoctory">
      <table border="0" height="200px" width="100%">
        <tr>
          <td width="40px" height="40px"><font>医生编号</font></td>
          <td width="5px"></td>
          <td width="100px">{{ list.doctor_id }}</td>
          <td width="50px"></td>
          <td width="40px"><font>医生姓名</font></td>
          <td width="5px"></td>
          <td width="100px">{{ list.doctor_name }}</td>
          <td width="50px"></td>
          <td width="40px"><font>医生头像</font></td>
          <td width="5px"></td>
          <td width="100px">
            <img
              width="40px"
              height="40px"
              style="border-radius: 100px"
              src="https://fuss10.elemecdn.com/2/11/6535bcfb26e4c79b48ddde44f4b6fjpeg.jpeg"
              alt=""
            />
          </td>
          <td width="56px"></td>
          <td width="40px"><font>联系电话</font></td>
          <td width="5px"></td>
          <td width="119px">{{ list.doctor_phone }}</td>
        </tr>

        <tr>
          <td align="right" height="60px" width="40px"><font>性别</font></td>
          <td width="5px"></td>
          <td colspan="13">{{ list.doctor_sex == 1 ? "男" : "女" }}</td>
        </tr>

        <tr>
          <td align="right" width="40px" valign="top" height="50px">
            <font>医生简历</font>
          </td>
          <td width="5px"></td>
          <td colspan="13" valign="top">
            {{ list.doctor_info }}
          </td>
        </tr>
        <tr>
          <td align="right" width="40px" height="50px" valign="top">
            <font>医生擅长</font>
          </td>
          <td width="5px"></td>
          <td colspan="13" valign="top">
            {{ list.doctor_adept }}
          </td>
        </tr>
      </table>
    </div>
    <div class="diwudoctory">
      <hr color="#F7FAFD" />
    </div>
    <div class="diliudoctory">
      <table width="100%" height="250px" border="0">
        <tr>
          <td width="60px" valign="top" height="50px"><font>加入团队</font></td>
          <td width="5px"></td>
          <td valign="top">
            北京市怀柔区洛西社区卫生服务站/李明明团队/全科护士<br /><br />
            北京市怀柔区五院社区卫生服务站/王强团队/全科护士
          </td>
        </tr>

        <tr>
          <td width="60px"><font>签约人数</font></td>
          <td width="5px"></td>
          <td>{{ list.sign_count }}</td>
        </tr>

        <tr>
          <td width="60px"><font>医生评分</font></td>
          <td width="5px"></td>
          <td>{{list.doctor_score}}（<font>900人评价</font>）</td>
        </tr>

        <tr>
          <td width="60px"><font>创建时间</font></td>
          <td width="5px"></td>
          <td>{{ list.create_date }}</td>
        </tr>

        <tr>
          <td width="60px"><font>创建人</font></td>
          <td width="5px"></td>
          <td>{{ list.create_people }}</td>
        </tr>

        <tr>
          <td width="60px"><font>账号状态</font></td>
          <td width="5px"></td>
          <td>
            <el-switch
              v-model="value"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </td>
        </tr>
      </table>
    </div>
    <div class="diqidoctory">
      <hr color="#F7FAFD" />
    </div>
    <div class="dibadoctory">
      <el-button type="primary">发送消息</el-button>
      <el-button type="primary" @click="binaji()">编辑医生信息</el-button>
      <el-button type="danger" @click="del()">删除</el-button>
      <el-button plain @click="fanhiu()">返回</el-button>
    </div>
  </div>
</template>

<script>
import axios from "axios";
axios.defaults.baseURL = "http://localhost:8080/";
export default {
  data() {
    return {
      list: {},
      value: true,
    };
  },
  methods: {
    del() {
      axios({
        url: "doctor/del",
        method: "GET",
        params: {
          id: this.list.doctor_id,
        },
      }).then((res) => {
        this.$notify({
          title: '成功',
          message: '删除成功',
          type: 'success'
        });
        this.$router.push({
          path: "/datas01",
        });
      });
    },
    binaji() {
      this.$router.push({
        path: "/serve07",
        query: {
          id: this.list.doctor_id,
        },
      });
    },
    fanhiu() {
      this.$router.push({
        path: "/datas01",
      });
    },
    quertList() {
      axios({
        url: "doctor/getDoctorById",
        method: "GET",
        params: {
          id: this.$route.query.id,
        },
      }).then((res) => {
        this.list = res.data; //把值传到list里面
        console.log(res);
      });
    },
  },
  created() {
    this.quertList(),
      document
        .querySelector("body")
        .setAttribute("style", "background-color:#F2F7FB");
  },
};
</script>

<style>
.dibadoctory {
  float: left;
  width: 96%;
  height: 70px;
  margin-left: 2%;
  margin-top: 2%;
  /* background-color: red; */
}
.diqidoctory {
  float: left;
  width: 96%;
  margin-left: 2%;
  margin-top: 14%;
}
.diliudoctory font {
  color: #9999a6;
}
.diliudoctory {
  float: left;
  width: 96%;
  height: 100px;
  margin-left: 2%;
  margin-top: 2%;
  /* background-color: red; */
  font-size: 13px;
}
.diwudoctory {
  float: left;
  height: 10px;
  width: 96%;
  margin-left: 2%;
}
.disidoctory font {
  color: #9999a6;
}
.disidoctory {
  float: left;
  width: 96%;
  /* background-color: red; */
  margin-left: 2%;
  margin-top: 1%;
  font-size: 13px;
}
.disandoctory {
  float: left;
  width: 98%;
  height: 20px;
  margin-left: 2%;
  font-size: 16px;
  margin-top: 2%;
}
.dierdoctory {
  float: left;
  height: 10px;
  width: 96%;
  margin-left: 2%;
  margin-top: 1.5%;
  /* background-color: blue; */
}
.diyidoctory {
  width: 6px;
  height: 20px;
  background-color: #2984f8;
  border-radius: 5px;
  margin-left: 2%;
  display: inline-block;
  margin-right: 10px;
}
.doctorytitle {
  width: 100%;
  height: 40px;
  font-size: 18px;
  display: flex;
  align-items: center;
  /* background: rgb(255, 214, 214); */
}
.doctoryishengshengtop {
  width: 1150px;
  height: 730px;
  background: white;
  margin: 20px auto;
  box-sizing: border-box;
  padding: 10px;
}
</style>